package com.peas.platform.framework.mybatisplus.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.peas.platform.common.core.dto.BaseDto;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @param <D>
 * @author caizhh
 */
public abstract class BaseServiceImpl<D extends BaseDto> implements BaseService<D> {

    @Transactional
    @Override
    public int save(D dto) {
        return getDomain().save(dto);
    }

    @Transactional
    @Override
    public boolean saveBatch(List<D> dtoList) {
        return getDomain().saveBatch(dtoList);
    }

    @Transactional
    @Override
    public boolean saveBatchAsync(List<D> dtoList) {
        return getDomain().saveBatchAsync(dtoList);
    }

    @Transactional
    @Override
    public boolean saveBatchAsync(List<D> dtoList, int splitSize) {
        return getDomain().saveBatchAsync(dtoList, splitSize);
    }

    @Transactional
    @Override
    public int removeById(Serializable id) {
        return getDomain().removeById(id);
    }

    @Transactional
    @Override
    public int removeById(D dto) {
        return getDomain().removeById(dto);
    }

    @Transactional
    @Override
    public int remove(D condition) {
        return getDomain().remove(condition);
    }

    @Transactional
    @Override
    public boolean removeBatchByList(List<D> list) {
        return getDomain().removeBatchByList(list);
    }

    @Transactional
    @Override
    public boolean removeBatchByIds(List<? extends Serializable> idList) {
        return getDomain().removeBatchByIds(idList);
    }

    @Transactional
    @Override
    public boolean removeBatchByListAsync(List<D> dtoList) {
        return getDomain().removeBatchByListAsync(dtoList);
    }

    @Transactional
    @Override
    public boolean removeBatchByListAsync(List<D> dtoList, int splitSize) {
        return getDomain().removeBatchByListAsync(dtoList, splitSize);
    }

    @Transactional
    @Override
    public int updateById(D dto) {
        return getDomain().updateById(dto);
    }

    @Transactional
    @Override
    public boolean updateBatchById(List<D> dtoList) {
        return getDomain().updateBatchById(dtoList);
    }

    @Transactional
    @Override
    public boolean updateBatchByIdAsync(List<D> dtoList) {
        return getDomain().updateBatchByIdAsync(dtoList);
    }

    @Transactional
    @Override
    public boolean updateBatchByIdAsync(List<D> dtoList, int splitSize) {
        return getDomain().updateBatchByIdAsync(dtoList, splitSize);
    }

    @Transactional
    @Override
    public int saveOrUpdate(D dto) {
        return getDomain().saveOrUpdate(dto);
    }

    @Override
    public D getById(Serializable id) {
        return getDomain().getById(id);
    }

    @Override
    public List<D> listByIds(List<? extends Serializable> idList) {
        return getDomain().listByIds(idList);
    }

    @Override
    public List<D> listByField(String field, Serializable value) {
        return getDomain().listByField(field, value);
    }

    @Override
    public Page<D> pageByField(String field, Serializable value, Page<D> page) {
        return getDomain().pageByField(field, value, page);
    }

    @Override
    public List<D> listByField(String field, List<? extends Serializable> values) {
        return getDomain().listByField(field, values);
    }

    @Override
    public Page<D> pageByField(String field, List<? extends Serializable> values, Page<D> page) {
        return getDomain().pageByField(field, values, page);
    }

    @Override
    public List<D> listByField(String field, Set<? extends Serializable> values) {
        return getDomain().listByField(field, values);
    }

    @Override
    public Page<D> pageByField(String field, Set<? extends Serializable> values, Page<D> page) {
        return getDomain().pageByField(field, values, page);
    }

    @Override
    public List<D> listByFieldAsync(String field, List<? extends Serializable> values) {
        return getDomain().listByFieldAsync(field, values);
    }

    @Override
    public List<D> listByFieldAsync(String field, List<? extends Serializable> values, int splitSize) {
        return getDomain().listByFieldAsync(field, values, splitSize);
    }

    @Override
    public List<D> listByFieldAsync(String field, Set<? extends Serializable> values) {
        return getDomain().listByFieldAsync(field, values);
    }

    @Override
    public List<D> listByFieldAsync(String field, Set<? extends Serializable> values, int splitSize) {
        return getDomain().listByFieldAsync(field, values, splitSize);
    }

    @Override
    public List<D> listByMap(Map<String, Object> columnMap) {
        return getDomain().listByMap(columnMap);
    }

    @Override
    public D getOne(D condition) {
        return getDomain().getOne(condition);
    }

    @Override
    public D getOne(D condition, boolean throwEx) {
        return getDomain().getOne(condition, throwEx);
    }

    @Override
    public Map<String, Object> getMap(D condition) {
        return getDomain().getMap(condition);
    }

    @Override
    public long count() {
        return getDomain().count();
    }

    @Override
    public long count(D condition) {
        return getDomain().count(condition);
    }

    @Override
    public <T extends Serializable> T abs(String field, D condition) {
        return getDomain().abs(field, condition);
    }

    @Override
    public Page<Map<String, Object>> abs(String field, Page<D> page, D condition, String... groupField) {
        return getDomain().abs(field, page, condition, groupField);
    }

    @Override
    public <T extends Serializable> T avg(String field, D condition) {
        return getDomain().avg(field, condition);
    }

    @Override
    public Page<Map<String, Object>> avg(String field, Page<D> page, D condition, String... groupField) {
        return getDomain().avg(field, page, condition, groupField);
    }

    @Override
    public <T extends Serializable> T sum(String field, D condition) {
        return getDomain().sum(field, condition);
    }

    @Override
    public Page<Map<String, Object>> sum(String field, Page<D> page, D condition, String... groupField) {
        return getDomain().sum(field, page, condition, groupField);
    }

    @Override
    public <T extends Serializable> T max(String field, D condition) {
        return getDomain().max(field, condition);
    }

    @Override
    public Page<Map<String, Object>> max(String field, Page<D> page, D condition, String... groupField) {
        return getDomain().max(field, page, condition, groupField);
    }

    @Override
    public <T extends Serializable> T min(String field, D condition) {
        return getDomain().min(field, condition);
    }

    @Override
    public Page<Map<String, Object>> min(String field, Page<D> page, D condition, String... groupField) {
        return getDomain().min(field, page, condition, groupField);
    }

    @Override
    public void checkRepetition(String field, String value) {
        getDomain().checkRepetition(field, value);
    }

    @Override
    public List<D> list() {
        return getDomain().list();
    }

    @Override
    public List<D> list(D condition) {
        return getDomain().list(condition);
    }

    @Override
    public Page<D> page(Page<D> page) {
        return getDomain().page(page);
    }

    @Override
    public Page<D> page(Page<D> page, String sortField, String sortType) {
        return getDomain().page(page, sortField, sortType);
    }

    @Override
    public Page<D> page(Page<D> page, D condition) {
        return getDomain().page(page, condition);
    }

    @Override
    public Page<D> page(Page<D> page, String sortField, String sortType, D condition) {
        return getDomain().page(page, sortField, sortType, condition);
    }

    @Deprecated
    @Override
    public Page<D> page(D condition) {
        return getDomain().page(condition);
    }

    @Override
    public Page<D> page(Page<D> page, Map<String, Object> condition) {
        return getDomain().page(page, condition);
    }

    @Override
    public Page<D> page(Page<D> page, String sortField, String sortType, Map<String, Object> condition) {
        return getDomain().page(page, sortField, sortType, condition);
    }

    @Deprecated
    @Override
    public Page<D> page(Map<String, Object> condition) {
        return getDomain().page(condition);
    }

    @Override
    public List<Map<String, Object>> listMaps() {
        return getDomain().listMaps();
    }

    @Override
    public List<Map<String, Object>> listMaps(D condition) {
        return getDomain().listMaps(condition);
    }

    @Override
    public Page<Map<String, Object>> pageMaps(Page<D> page) {
        return getDomain().pageMaps(page);
    }

    @Override
    public Page<Map<String, Object>> pageMaps(Page<D> page, String sortField, String sortType) {
        return getDomain().pageMaps(page, sortField, sortType);
    }

    @Override
    public Page<Map<String, Object>> pageMaps(Page<D> page, D condition) {
        return getDomain().pageMaps(page, condition);
    }

    @Override
    public Page<Map<String, Object>> pageMaps(Page<D> page, String sortField, String sortType, D condition) {
        return getDomain().pageMaps(page, sortField, sortType, condition);
    }

    @Override
    public Page<Map<String, Object>> pageMaps(Page<D> page, Map<String, Object> condition) {
        return getDomain().pageMaps(page, condition);
    }

    @Override
    public Page<Map<String, Object>> pageMaps(Page<D> page, String sortField, String sortType, Map<String, Object> condition) {
        return getDomain().pageMaps(page, sortField, sortType, condition);
    }

}
